package com.flexcodejam.vfd.control
{
	import com.adobe.cairngorm.control.FrontController;
	
	import com.flexcodejam.vfd.command.LoginUserCommand;
	
	import com.flexcodejam.vfd.command.*;
		
	
	import com.flexcodejam.vfd.command.GetFoodDrivebyManagerIdCommand;
	import com.flexcodejam.vfd.event.FoodDriveEvent;
	
	import com.flexcodejam.vfd.event.UserEvent;
	import com.flexcodejam.vfd.event.DonationEvent;
	import com.flexcodejam.vfd.event.OrganizationEvent;
	import com.flexcodejam.vfd.event.ChangeMainViewStackEvent;
	

	public class VFDFrontController extends FrontController
	{
		
		public function VFDFrontController()
		{
			initialiseCommands();
		}
		
		public function initialiseCommands():void
		{
			addCommand(UserEvent.LOGIN, LoginUserCommand);	  
			addCommand(UserEvent.SAVE, SaveUserCommand);	  
			
			addCommand(FoodDriveEvent.GetById, GetFoodDriveCommandById);	  
			addCommand(FoodDriveEvent.GetAll, GetAllFoodDrivesCommand);	  
			addCommand(FoodDriveEvent.Save, SaveFoodDriveCommand);	  
			addCommand(FoodDriveEvent.GetByManagerId, GetFoodDrivebyManagerIdCommand);
			
			addCommand(DonationEvent.MakeDonation, SaveDonationCommand);
			addCommand(DonationEvent.GetDonationByUserId, GetDonationsByUserIdCommand);
			addCommand(DonationEvent.GetDonationByFoodDriveId, GetDonationsByFoodDriveIdCommand);			
				
			addCommand(OrganizationEvent.SaveOrganization, SaveOrganizationCommand);
			addCommand(OrganizationEvent.GetOrganizationById, GetOrganizationByIdCommand);
			addCommand(OrganizationEvent.GetAllOrganizations, GetAllOrganizationsCommand);			
			
			
			
			addCommand(ChangeMainViewStackEvent.GO_TO_DONATION_BOARD, ChangeMainViewStackCommand);			
			addCommand(ChangeMainViewStackEvent.GO_TO_FOOD_DRIVE_VIEW, ChangeMainViewStackCommand);	
			addCommand(ChangeMainViewStackEvent.GO_TO_MAKE_DONATION, ChangeMainViewStackCommand);	
			addCommand(ChangeMainViewStackEvent.GO_TO_CONFIRMATION, ChangeMainViewStackCommand);	
			
			addCommand(ChangeMainViewStackEvent.GO_TO_NEW_EDIT_FOOD_DRIVE, ChangeMainViewStackCommand);	
			addCommand(ChangeMainViewStackEvent.GO_TO_EDIT_FOOD_DRIVE, ChangeMainViewStackCommand);	
			addCommand(ChangeMainViewStackEvent.GO_TO_SUPER_USER, ChangeMainViewStackCommand);
			addCommand(ChangeMainViewStackEvent.GO_TO_THANK_YOU, ChangeMainViewStackCommand);

			
			
			 	
		}	
		
	}
	
}